#ifndef __TRANS_FILE__
#define __TRANS_FILE__

#include <mysql/mysql.h>

int calculate_md5(const int fd, char md5[16]);

int send_file(const int net_fd, const char *filename, const char *real_path);

int recv_file(const int net_fd, const char *filename);

int download(MYSQL *db, const int netfd, const char *filename, const char *path);

// INSERT INTO file_system (md5, user, type, name, path, pre) VALUES (md5, username, 'f', filename, cwd/filename, cwd);
int upload(MYSQL *db, const int netfd, const char *username, const char *filename, const char *cwd, const char *md5);

#endif // !__TRANS_FILE__
